if (Meteor.is_client) {
  
  Template.modal_view.events = {
  
    'click a.remove': function(e){
      e.preventDefault();
      Template[this.type + "_view"].events.remove();
    }
  
  };

  Template.makeRemoveModal = function(title, type, viewname, message){
    var $mc = $("#modal_container")
      , body = message || "Are you sure you want to remove this " + type + "?";
  
    Template.modal_view.events = {
      'click a.remove': function(e){
        console.log(viewname);
        e.preventDefault();
        Template[viewname].events.remove();
      }
    };
  
    $mc.empty();
    $mc.append(
      Meteor.ui.render(function(){
        return Template.modal_view({title: title, type: type, body: body});
      }.bind(this))
    )
    .modal();
  
  };
  
}